
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>第二节 学习率 · Tensorflow学习笔记</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="scottdu">
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-katex/katex.min.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-tbfed-pagefooter/footer.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-alerts/style.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-donate/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-splitter/splitter.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="section2.3.html" />
    
    
    <link rel="prev" href="section2.1.html" />
    

    
    <link rel="stylesheet" href="../gitbook/gitbook-plugin-chart/c3/c3.min.css">
    <script src="../gitbook/gitbook-plugin-chart/c3/d3.min.js"></script>
    <script src="../gitbook/gitbook-plugin-chart/c3/c3.min.js"></script>
    

    <script src="../gitbook/gitbook-plugin-graph/d3.min.js"></script>
    <script src="../gitbook/gitbook-plugin-graph/function-plot.js"></script>    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    简介
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../chapter1/">
            
                <a href="../chapter1/">
            
                    
                    第一章 Tensorflow框架
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="../chapter1/section1.1.html">
            
                <a href="../chapter1/section1.1.html">
            
                    
                    第一节 张量、计算图、会话
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="../chapter1/section1.2.html">
            
                <a href="../chapter1/section1.2.html">
            
                    
                    第二节 前向传播
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3" data-path="../chapter1/section1.3.html">
            
                <a href="../chapter1/section1.3.html">
            
                    
                    第三节 反向传播
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.4" data-path="../chapter1/section1.4.html">
            
                <a href="../chapter1/section1.4.html">
            
                    
                    第四节 搭建神经网络的步骤
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="./">
            
                <a href="./">
            
                    
                    第二章 神经网络优化
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="section2.1.html">
            
                <a href="section2.1.html">
            
                    
                    第一节 损失函数
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.3.2" data-path="section2.2.html">
            
                <a href="section2.2.html">
            
                    
                    第二节 学习率
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="section2.3.html">
            
                <a href="section2.3.html">
            
                    
                    第三节 滑动平均
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.4" data-path="section2.4.html">
            
                <a href="section2.4.html">
            
                    
                    第四节 正则化
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.5" data-path="section2.5.html">
            
                <a href="section2.5.html">
            
                    
                    第五节 神经网络的搭建
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../chapter3/">
            
                <a href="../chapter3/">
            
                    
                    第三章 全连接网络基础
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="../chapter3/section3.1.html">
            
                <a href="../chapter3/section3.1.html">
            
                    
                    第一节 MINIST数据
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="../chapter3/section3.2.html">
            
                <a href="../chapter3/section3.2.html">
            
                    
                    第二节 模块化搭建神经网络方法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="../chapter3/section3.3.html">
            
                <a href="../chapter3/section3.3.html">
            
                    
                    第三节 手写数字识别准确率输出
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="../chapter4/">
            
                <a href="../chapter4/">
            
                    
                    第四章 全连接网络实践
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="../chapter4/section4.1.html">
            
                <a href="../chapter4/section4.1.html">
            
                    
                    第一节 输入手写数字图片输出识别结果
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="../chapter4/section4.2.html">
            
                <a href="../chapter4/section4.2.html">
            
                    
                    第二节 制作数据集
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="../chapter5/">
            
                <a href="../chapter5/">
            
                    
                    第五章 卷积网络基础
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="../chapter5/section5.1.html">
            
                <a href="../chapter5/section5.1.html">
            
                    
                    第一节 卷积神经网络
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="../chapter5/section5.2.html">
            
                <a href="../chapter5/section5.2.html">
            
                    
                    第二节 lenel5代码讲解
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="../chapter6/">
            
                <a href="../chapter6/">
            
                    
                    第六章 卷积网络实践
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="../chapter5/section6.1.html">
            
                <a href="../chapter5/section6.1.html">
            
                    
                    第一节 复现已有的卷积神经网络
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2" data-path="../chapter6/section6.2.html">
            
                <a href="../chapter6/section6.2.html">
            
                    
                    第二节 用vgg16实现图片识别
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="../chapter7/">
            
                <a href="../chapter7/">
            
                    
                    第七章 Tensorflow应用
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >第二节 学习率</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="&#x7B2C;&#x4E8C;&#x8282;-&#x5B66;&#x4E60;&#x7387;">&#x7B2C;&#x4E8C;&#x8282; &#x5B66;&#x4E60;&#x7387;</h1>
<ul>
<li>&#x5B66;&#x4E60;&#x7387;<code>learning_rate</code>:&#x8868;&#x793A;&#x4E86;&#x6BCF;&#x6B21;&#x53C2;&#x6570;&#x66F4;&#x65B0;&#x7684;&#x5E45;&#x5EA6;&#x5927;&#x5C0F;&#x3002;&#x5B66;&#x4E60;&#x7387;&#x8FC7;&#x5927;&#xFF0C;&#x4F1A;&#x5BFC;&#x81F4;&#x5F85;&#x4F18;&#x5316;&#x7684;&#x53C2;&#x6570;&#x5728;&#x6700;&#x5C0F;&#x503C;&#x9644;&#x8FD1;&#x6CE2;&#x52A8;&#xFF0C;&#x4E0D;&#x6536;&#x655B;&#xFF1B;&#x5B66;&#x4E60;&#x7387;&#x8FC7;&#x5C0F;&#xFF0C;&#x4F1A;&#x5BFC;&#x81F4;&#x5F85;&#x4F18;&#x5316;&#x7684;&#x53C2;&#x6570;&#x6536;&#x655B;&#x7F13;&#x6162;&#x3002;&#x5728;&#x8BAD;&#x7EC3;&#x8FC7;&#x7A0B;&#x4E2D;&#xFF0C;&#x53C2;&#x6570;&#x7684;&#x66F4;&#x65B0;&#x5411;&#x7740;&#x635F;&#x5931;&#x51FD;&#x6570;&#x68AF;&#x5EA6;&#x4E0B;&#x964D;&#x7684;&#x65B9;&#x5411;&#x3002;&#x53C2;&#x6570;&#x7684;&#x66F4;&#x65B0;&#x516C;&#x5F0F;&#x4E3A;
<span class="katex"><span class="katex-mathml"><math><semantics><mrow><msub><mi>w</mi><mrow><mi>n</mi><mo>+</mo><mn>1</mn></mrow></msub><mo>=</mo><msub><mi>w</mi><mrow><mi>n</mi></mrow></msub><mo>&#x2212;</mo><mi>l</mi><mi>e</mi><mi>a</mi><mi>r</mi><mi>n</mi><mi>i</mi><mi>n</mi><mi>g</mi><mi mathvariant="normal">_</mi><mi>r</mi><mi>a</mi><mi>t</mi><mi>e</mi><mi mathvariant="normal">&#x394;</mi></mrow><annotation encoding="application/x-tex">w_{n+1}=w_{n}-learning\_rate\Delta</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="strut" style="height:0.69444em;"></span><span class="strut bottom" style="height:1.00444em;vertical-align:-0.31em;"></span><span class="base textstyle uncramped"><span class="mord"><span class="mord mathit" style="margin-right:0.02691em;">w</span><span class="msupsub"><span class="vlist"><span style="top:0.15em;margin-right:0.05em;margin-left:-0.02691em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span><span class="reset-textstyle scriptstyle cramped mtight"><span class="mord scriptstyle cramped mtight"><span class="mord mathit mtight">n</span><span class="mbin mtight">+</span><span class="mord mathrm mtight">1</span></span></span></span><span class="baseline-fix"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span>&#x200B;</span></span></span></span><span class="mrel">=</span><span class="mord"><span class="mord mathit" style="margin-right:0.02691em;">w</span><span class="msupsub"><span class="vlist"><span style="top:0.15em;margin-right:0.05em;margin-left:-0.02691em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span><span class="reset-textstyle scriptstyle cramped mtight"><span class="mord scriptstyle cramped mtight"><span class="mord mathit mtight">n</span></span></span></span><span class="baseline-fix"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span>&#x200B;</span></span></span></span><span class="mbin">&#x2212;</span><span class="mord mathit" style="margin-right:0.01968em;">l</span><span class="mord mathit">e</span><span class="mord mathit">a</span><span class="mord mathit" style="margin-right:0.02778em;">r</span><span class="mord mathit">n</span><span class="mord mathit">i</span><span class="mord mathit">n</span><span class="mord mathit" style="margin-right:0.03588em;">g</span><span class="mord mathrm" style="margin-right:0.02778em;">_</span><span class="mord mathit" style="margin-right:0.02778em;">r</span><span class="mord mathit">a</span><span class="mord mathit">t</span><span class="mord mathit">e</span><span class="mord mathrm">&#x394;</span></span></span></span></li>
</ul>
<p>&#x5047;&#x8BBE;&#x635F;&#x5931;&#x51FD;&#x6570;&#x4E3A;<span class="katex"><span class="katex-mathml"><math><semantics><mrow><mi>l</mi><mi>o</mi><mi>s</mi><mi>s</mi><mo>=</mo><mo>(</mo><mi>w</mi><mo>+</mo><mn>1</mn><msup><mo>)</mo><mn>2</mn></msup></mrow><annotation encoding="application/x-tex">loss=(w+1)^2</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="strut" style="height:0.8141079999999999em;"></span><span class="strut bottom" style="height:1.064108em;vertical-align:-0.25em;"></span><span class="base textstyle uncramped"><span class="mord mathit" style="margin-right:0.01968em;">l</span><span class="mord mathit">o</span><span class="mord mathit">s</span><span class="mord mathit">s</span><span class="mrel">=</span><span class="mopen">(</span><span class="mord mathit" style="margin-right:0.02691em;">w</span><span class="mbin">+</span><span class="mord mathrm">1</span><span class="mclose"><span class="mclose">)</span><span class="msupsub"><span class="vlist"><span style="top:-0.363em;margin-right:0.05em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span><span class="reset-textstyle scriptstyle uncramped mtight"><span class="mord mathrm mtight">2</span></span></span><span class="baseline-fix"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span>&#x200B;</span></span></span></span></span></span></span>&#x3002;&#x68AF;&#x5EA6;&#x662F;&#x635F;&#x5931;&#x51FD;&#x6570;<code>loss</code>&#x7684;&#x5BFC;&#x6570;<span class="katex"><span class="katex-mathml"><math><semantics><mrow><mi mathvariant="normal">&#x394;</mi><mo>=</mo><mn>2</mn><mi>w</mi><mo>+</mo><mn>2</mn></mrow><annotation encoding="application/x-tex">\Delta=2w+2</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="strut" style="height:0.68333em;"></span><span class="strut bottom" style="height:0.76666em;vertical-align:-0.08333em;"></span><span class="base textstyle uncramped"><span class="mord mathrm">&#x394;</span><span class="mrel">=</span><span class="mord mathrm">2</span><span class="mord mathit" style="margin-right:0.02691em;">w</span><span class="mbin">+</span><span class="mord mathrm">2</span></span></span></span>&#x3002;&#x5982;&#x53C2;&#x6570;&#x521D;&#x503C;&#x4E3A;5&#xFF0C;&#x5B66;&#x4E60;&#x7387;&#x4E3A;0.2&#xFF0C;&#x5219;&#x53C2;&#x6570;&#x548C;&#x635F;&#x5931;&#x51FD;&#x6570;&#x66F4;&#x65B0;&#x5982;&#x4E0B;&#xFF1A;</p>
<pre><code>1&#x6B21;  &#x53C2;&#x6570;w:5       5-0.2*(2*5+2)=2.6
2&#x6B21;  &#x53C2;&#x6570;w:2.6     2.6-0.2*(2*2.6+2)=1.16
3&#x6B21;  &#x53C2;&#x6570;w:1.16    1.16-0.2*(2*1.16+2)=0.296
4&#x6B21;  &#x53C2;&#x6570;w:0.296
</code></pre><p>&#x635F;&#x5931;&#x51FD;&#x6570;<span class="katex"><span class="katex-mathml"><math><semantics><mrow><mi>l</mi><mi>o</mi><mi>s</mi><mi>s</mi><mo>=</mo><mo>(</mo><mi>w</mi><mo>+</mo><mn>1</mn><msup><mo>)</mo><mn>2</mn></msup></mrow><annotation encoding="application/x-tex">loss=(w+1)^2</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="strut" style="height:0.8141079999999999em;"></span><span class="strut bottom" style="height:1.064108em;vertical-align:-0.25em;"></span><span class="base textstyle uncramped"><span class="mord mathit" style="margin-right:0.01968em;">l</span><span class="mord mathit">o</span><span class="mord mathit">s</span><span class="mord mathit">s</span><span class="mrel">=</span><span class="mopen">(</span><span class="mord mathit" style="margin-right:0.02691em;">w</span><span class="mbin">+</span><span class="mord mathrm">1</span><span class="mclose"><span class="mclose">)</span><span class="msupsub"><span class="vlist"><span style="top:-0.363em;margin-right:0.05em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span><span class="reset-textstyle scriptstyle uncramped mtight"><span class="mord mathrm mtight">2</span></span></span><span class="baseline-fix"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span>&#x200B;</span></span></span></span></span></span></span>&#x7684;&#x56FE;&#x50CF;&#x4E3A;&#xFF1A;</p>
<p><img src="http://ovhbzkbox.bkt.clouddn.com/2018-07-26-15325368607915.jpg" width="200"></p>
<p>&#x7531;&#x56FE;&#x53EF;&#x77E5;&#xFF0C;&#x635F;&#x5931;&#x51FD;&#x6570;loss&#x7684;&#x6700;&#x5C0F;&#x503C;&#x4F1A;&#x5728;(-1,0)&#x5904;&#x5F97;&#x5230;&#xFF0C;&#x6B64;&#x65F6;&#x635F;&#x5931;&#x51FD;&#x6570;&#x7684;&#x5BFC;&#x6570;&#x4E3A;0,&#x5F97;&#x5230;&#x6700;&#x7EC8;&#x53C2;&#x6570;w=-1&#x3002;&#x4EE3;&#x7801;&#x5982;&#x4E0B;:</p>
<pre><code>#encoding:utf-8
#&#x8BBE;&#x635F;&#x5931;&#x51FD;&#x6570;loss=(w+1)^2&#xFF0C;&#x4EE4;w&#x521D;&#x503C;&#x662F;&#x5E38;&#x6570;5&#x3002;&#x53CD;&#x5411;&#x4F20;&#x64AD;&#x5C31;&#x662F;&#x6C42;&#x6700;&#x4F18;y&#xFF0C;&#x5373;&#x6C42;&#x6700;&#x5C0F;loss&#x5BF9;&#x5E94;&#x7684;w&#x503C;
import tensorflow as tf
#&#x5B9A;&#x4E49;&#x5F85;&#x4F18;&#x5316;&#x53C2;&#x6570;w&#x521D;&#x503C;&#x8D4B;5
w = tf.Variable(tf.constant(5,dtype=tf.float32))

#&#x5B9A;&#x4E49;&#x635F;&#x5931;&#x51FD;&#x6570;loss
loss = tf.square(w+1)
#&#x5B9A;&#x4E49;&#x53CD;&#x5411;&#x4F20;&#x64AD;&#x65B9;&#x6CD5;
train_step = tf.train.GradientDescentOptimizer(0.2).minimize(loss)

#&#x751F;&#x6210;&#x4F1A;&#x8BDD;&#xFF0C;&#x8BAD;&#x7EC3;40&#x8F6E;
with tf.Session() as sess:
  init_op = tf.global_variables_initializer()
  sess.run(init_op)
  for i in range(40):
    sess.run(train_step)
    w_val = sess.run(w)
    loss_val = sess.run(loss)
    print(&quot;After %s steps: w is %f, loss is %f.&quot; % (i, w_val, loss_val))
</code></pre><p>&#x8FD0;&#x884C;&#x7ED3;&#x679C;&#x5982;&#x4E0B;&#xFF1A;</p>
<pre><code>After 30 steps: w is -0.999999, loss is 0.000000
After 31 steps: w is -1.000000, loss is 0.000000
After 32 steps: w is -1.000000, loss is 0.000000
After 33 steps: w is -1.000000, loss is 0.000000
After 34 steps: w is -1.000000, loss is 0.000000
After 35 steps: w is -1.000000, loss is 0.000000
After 36 steps: w is -1.000000, loss is 0.000000
After 37 steps: w is -1.000000, loss is 0.000000
After 38 steps: w is -1.000000, loss is 0.000000
After 39 steps: w is -1.000000, loss is 0.000000
</code></pre><p>&#x7531;&#x7ED3;&#x679C;&#x53EF;&#x77E5;&#xFF0C;&#x968F;&#x7740;&#x635F;&#x5931;&#x51FD;&#x6570;&#x503C;&#x7684;&#x51CF;&#x5C0F;&#xFF0C;<code>w</code>&#x65E0;&#x9650;&#x8D8B;&#x8FD1;&#x4E8E;-1&#xFF0C;&#x6A21;&#x578B;&#x8BA1;&#x7B97;&#x63A8;&#x6D4B;&#x51FA;&#x6700;&#x4F18;&#x53C2;&#x6570;<code>w=-1</code>&#x3002;</p>
<ul>
<li>&#x5B66;&#x4E60;&#x7387;&#x7684;&#x8BBE;&#x7F6E;&#xFF0C;&#x5B66;&#x4E60;&#x7387;&#x8FC7;&#x5927;&#xFF0C;&#x4F1A;&#x5BFC;&#x81F4;&#x5F85;&#x4F18;&#x5316;&#x7684;&#x53C2;&#x6570;&#x5728;&#x6700;&#x5C0F;&#x503C;&#x9644;&#x8FD1;&#x6CE2;&#x52A8;&#xFF0C;&#x4E0D;&#x6536;&#x655B;&#xFF1B;&#x5B66;&#x4E60;&#x7387;&#x8FC7;&#x5C0F;&#xFF0C;&#x4F1A;&#x5BFC;&#x81F4;&#x4F18;&#x5316;&#x53C2;&#x6570;&#x6536;&#x655B;&#x7F13;&#x6162;</li>
</ul>
<p><img src="http://ovhbzkbox.bkt.clouddn.com/2018-07-26-sgd.gif" alt="sgd">
<img src="http://ovhbzkbox.bkt.clouddn.com/2018-07-26-sgd_bad.gif" alt="sgd_bad"></p>
<p>&#x4F8B;&#x5982;&#xFF1A;(1)&#x5BF9;&#x4E8E;&#x4E0A;&#x4F8B;&#x7684;&#x635F;&#x5931;&#x51FD;&#x6570;<span class="katex"><span class="katex-mathml"><math><semantics><mrow><mi>l</mi><mi>o</mi><mi>s</mi><mi>s</mi><mo>=</mo><mo>(</mo><mi>w</mi><mo>+</mo><mn>1</mn><msup><mo>)</mo><mn>2</mn></msup></mrow><annotation encoding="application/x-tex">loss=(w+1)^2</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="strut" style="height:0.8141079999999999em;"></span><span class="strut bottom" style="height:1.064108em;vertical-align:-0.25em;"></span><span class="base textstyle uncramped"><span class="mord mathit" style="margin-right:0.01968em;">l</span><span class="mord mathit">o</span><span class="mord mathit">s</span><span class="mord mathit">s</span><span class="mrel">=</span><span class="mopen">(</span><span class="mord mathit" style="margin-right:0.02691em;">w</span><span class="mbin">+</span><span class="mord mathrm">1</span><span class="mclose"><span class="mclose">)</span><span class="msupsub"><span class="vlist"><span style="top:-0.363em;margin-right:0.05em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span><span class="reset-textstyle scriptstyle uncramped mtight"><span class="mord mathrm mtight">2</span></span></span><span class="baseline-fix"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span>&#x200B;</span></span></span></span></span></span></span>&#x3002;&#x5219;&#x5C06;&#x4E0A;&#x8FF0;&#x4EE3;&#x7801;&#x4E2D;&#x5B66;&#x4E60;&#x7387;&#x4FEE;&#x6539;&#x4E3A;1&#xFF0C;&#x5176;&#x4F59;&#x5185;&#x5BB9;&#x4E0D;&#x53D8;&#x3002;&#x5B9E;&#x9A8C;&#x7ED3;&#x679C;&#x5982;&#x4E0B;&#xFF1A;</p>
<pre><code>After 11 steps: w is 5.000000, loss is 36.000000
After 12 steps: w is -7.000000, loss is 36.000000
After 13 steps: w is 5.000000, loss is 36.000000
After 14 steps: w is -7.000000, loss is 36.000000
After 15 steps: w is 5.000000, loss is 36.000000
After 16 steps: w is -7.000000, loss is 36.000000
</code></pre><p>&#x8FD0;&#x884C;&#x7ED3;&#x679C;&#x53EF;&#x77E5;&#xFF0C;&#x635F;&#x5931;&#x51FD;&#x6570;<code>loss</code>&#x503C;&#x5E76;&#x6CA1;&#x6709;&#x6536;&#x655B;&#xFF0C;&#x800C;&#x662F;&#x5728;5&#x548C;-7&#x4E4B;&#x95F4;&#x6CE2;&#x52A8;&#x3002;</p>
<p>&#xFF08;2&#xFF09;&#x5BF9;&#x4E8E;&#x4E0A;&#x4F8B;&#x7684;&#x635F;&#x5931;&#x51FD;&#x6570;<span class="katex"><span class="katex-mathml"><math><semantics><mrow><mi>l</mi><mi>o</mi><mi>s</mi><mi>s</mi><mo>=</mo><mo>(</mo><mi>w</mi><mo>+</mo><mn>1</mn><msup><mo>)</mo><mn>2</mn></msup></mrow><annotation encoding="application/x-tex">loss=(w+1)^2</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="strut" style="height:0.8141079999999999em;"></span><span class="strut bottom" style="height:1.064108em;vertical-align:-0.25em;"></span><span class="base textstyle uncramped"><span class="mord mathit" style="margin-right:0.01968em;">l</span><span class="mord mathit">o</span><span class="mord mathit">s</span><span class="mord mathit">s</span><span class="mrel">=</span><span class="mopen">(</span><span class="mord mathit" style="margin-right:0.02691em;">w</span><span class="mbin">+</span><span class="mord mathrm">1</span><span class="mclose"><span class="mclose">)</span><span class="msupsub"><span class="vlist"><span style="top:-0.363em;margin-right:0.05em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span><span class="reset-textstyle scriptstyle uncramped mtight"><span class="mord mathrm mtight">2</span></span></span><span class="baseline-fix"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span>&#x200B;</span></span></span></span></span></span></span>&#x3002;&#x5219;&#x5C06;&#x4E0A;&#x8FF0;&#x4EE3;&#x7801;&#x4E2D;&#x5B66;&#x4E60;&#x7387;&#x4FEE;&#x6539;&#x4E3A;0.0001&#xFF0C;&#x5176;&#x4F59;&#x5185;&#x5BB9;&#x4E0D;&#x53D8;&#x3002;&#x5B9E;&#x9A8C;&#x7ED3;&#x679C;&#x5982;&#x4E0B;&#xFF1A;</p>
<pre><code>After 31 steps: w is 4.961716, loss is 35.542053
After 32 steps: w is 4.960523, loss is 35.527836
After 33 steps: w is 4.959311, loss is 35.513626
After 34 steps: w is 4.958139, loss is 35.499420
After 35 steps: w is 4.956947, loss is 35.485222
After 36 steps: w is 4.955756, loss is 35.471027
After 37 steps: w is 4.954565, loss is 35.456841
After 38 steps: w is 4.953373, loss is 35.442654
After 39 steps: w is 4.952183, loss is 35.428478
</code></pre><p>&#x7531;&#x8FD0;&#x884C;&#x7ED3;&#x679C;&#x53EF;&#x77E5;&#xFF0C;&#x635F;&#x5931;&#x51FD;&#x6570;<code>loss</code>&#x503C;&#x7F13;&#x6162;&#x4E0B;&#x964D;&#xFF0C;<code>w</code>&#x503C;&#x4E5F;&#x5728;&#x5C0F;&#x5E45;&#x5EA6;&#x53D8;&#x5316;&#xFF0C;&#x6536;&#x655B;&#x7F13;&#x6162;&#x3002;</p>
<ul>
<li>&#x6307;&#x6570;&#x8870;&#x51CF;&#x5B66;&#x4E60;&#x7387;: &#x5B66;&#x4E60;&#x7387;&#x968F;&#x7740;&#x8BAD;&#x7EC3;&#x8F6E;&#x6570;&#x53D8;&#x5316;&#x800C;&#x52A8;&#x6001;&#x66F4;&#x65B0;</li>
</ul>
<p><span class="katex"><span class="katex-mathml"><math><semantics><mrow><mi>L</mi><mi>e</mi><mi>a</mi><mi>r</mi><mi>n</mi><mi>i</mi><mi>n</mi><mi>g</mi><mi mathvariant="normal">_</mi><mi>r</mi><mi>a</mi><mi>t</mi><mi>e</mi><mo>=</mo><mi>L</mi><mi>E</mi><mi>A</mi><mi>R</mi><mi>N</mi><mi>I</mi><mi>N</mi><mi>G</mi><mi mathvariant="normal">_</mi><mi>R</mi><mi>A</mi><mi>T</mi><mi>E</mi><mi mathvariant="normal">_</mi><mi>B</mi><mi>A</mi><mi>S</mi><mi>E</mi><mo>&#x2217;</mo><mi>L</mi><mi>E</mi><mi>A</mi><mi>R</mi><mi>N</mi><mi>I</mi><mi>N</mi><mi>G</mi><mi mathvariant="normal">_</mi><mi>R</mi><mi>A</mi><mi>T</mi><mi>E</mi><mi mathvariant="normal">_</mi><mi>D</mi><mi>E</mi><mi>C</mi><mi>Y</mi><mo>&#x2217;</mo><mfrac><mrow><mi>g</mi><mi>l</mi><mi>o</mi><mi>b</mi><mi>a</mi><mi>l</mi><mi mathvariant="normal">_</mi><mi>s</mi><mi>t</mi><mi>e</mi><mi>p</mi></mrow><mrow><mi>L</mi><mi>E</mi><mi>A</mi><mi>R</mi><mi>N</mi><mi>I</mi><mi>N</mi><mi>G</mi><mi mathvariant="normal">_</mi><mi>R</mi><mi>A</mi><mi>T</mi><mi>E</mi><mi mathvariant="normal">_</mi><mi>B</mi><mi>A</mi><mi>T</mi><mi>C</mi><mi>H</mi><mi mathvariant="normal">_</mi><mi>S</mi><mi>I</mi><mi>Z</mi><mi>E</mi></mrow></mfrac></mrow><annotation encoding="application/x-tex">Learning\_rate=LEARNING\_RATE\_BASE*LEARNING\_RATE\_DECY*\frac{global\_step}{LEARNING\_RATE\_BATCH\_SIZE}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="strut" style="height:1.013108em;"></span><span class="strut bottom" style="height:1.5751079999999997em;vertical-align:-0.5619999999999999em;"></span><span class="base textstyle uncramped"><span class="mord mathit">L</span><span class="mord mathit">e</span><span class="mord mathit">a</span><span class="mord mathit" style="margin-right:0.02778em;">r</span><span class="mord mathit">n</span><span class="mord mathit">i</span><span class="mord mathit">n</span><span class="mord mathit" style="margin-right:0.03588em;">g</span><span class="mord mathrm" style="margin-right:0.02778em;">_</span><span class="mord mathit" style="margin-right:0.02778em;">r</span><span class="mord mathit">a</span><span class="mord mathit">t</span><span class="mord mathit">e</span><span class="mrel">=</span><span class="mord mathit">L</span><span class="mord mathit" style="margin-right:0.05764em;">E</span><span class="mord mathit">A</span><span class="mord mathit" style="margin-right:0.00773em;">R</span><span class="mord mathit" style="margin-right:0.10903em;">N</span><span class="mord mathit" style="margin-right:0.07847em;">I</span><span class="mord mathit" style="margin-right:0.10903em;">N</span><span class="mord mathit">G</span><span class="mord mathrm" style="margin-right:0.02778em;">_</span><span class="mord mathit" style="margin-right:0.00773em;">R</span><span class="mord mathit">A</span><span class="mord mathit" style="margin-right:0.13889em;">T</span><span class="mord mathit" style="margin-right:0.05764em;">E</span><span class="mord mathrm" style="margin-right:0.02778em;">_</span><span class="mord mathit" style="margin-right:0.05017em;">B</span><span class="mord mathit">A</span><span class="mord mathit" style="margin-right:0.05764em;">S</span><span class="mord mathit" style="margin-right:0.05764em;">E</span><span class="mbin">&#x2217;</span><span class="mord mathit">L</span><span class="mord mathit" style="margin-right:0.05764em;">E</span><span class="mord mathit">A</span><span class="mord mathit" style="margin-right:0.00773em;">R</span><span class="mord mathit" style="margin-right:0.10903em;">N</span><span class="mord mathit" style="margin-right:0.07847em;">I</span><span class="mord mathit" style="margin-right:0.10903em;">N</span><span class="mord mathit">G</span><span class="mord mathrm" style="margin-right:0.02778em;">_</span><span class="mord mathit" style="margin-right:0.00773em;">R</span><span class="mord mathit">A</span><span class="mord mathit" style="margin-right:0.13889em;">T</span><span class="mord mathit" style="margin-right:0.05764em;">E</span><span class="mord mathrm" style="margin-right:0.02778em;">_</span><span class="mord mathit" style="margin-right:0.02778em;">D</span><span class="mord mathit" style="margin-right:0.05764em;">E</span><span class="mord mathit" style="margin-right:0.07153em;">C</span><span class="mord mathit" style="margin-right:0.22222em;">Y</span><span class="mbin">&#x2217;</span><span class="mord reset-textstyle textstyle uncramped"><span class="mopen sizing reset-size5 size5 reset-textstyle textstyle uncramped nulldelimiter"></span><span class="mfrac"><span class="vlist"><span style="top:0.345em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span><span class="reset-textstyle scriptstyle cramped mtight"><span class="mord scriptstyle cramped mtight"><span class="mord mathit mtight">L</span><span class="mord mathit mtight" style="margin-right:0.05764em;">E</span><span class="mord mathit mtight">A</span><span class="mord mathit mtight" style="margin-right:0.00773em;">R</span><span class="mord mathit mtight" style="margin-right:0.10903em;">N</span><span class="mord mathit mtight" style="margin-right:0.07847em;">I</span><span class="mord mathit mtight" style="margin-right:0.10903em;">N</span><span class="mord mathit mtight">G</span><span class="mord mathrm mtight" style="margin-right:0.02778em;">_</span><span class="mord mathit mtight" style="margin-right:0.00773em;">R</span><span class="mord mathit mtight">A</span><span class="mord mathit mtight" style="margin-right:0.13889em;">T</span><span class="mord mathit mtight" style="margin-right:0.05764em;">E</span><span class="mord mathrm mtight" style="margin-right:0.02778em;">_</span><span class="mord mathit mtight" style="margin-right:0.05017em;">B</span><span class="mord mathit mtight">A</span><span class="mord mathit mtight" style="margin-right:0.13889em;">T</span><span class="mord mathit mtight" style="margin-right:0.07153em;">C</span><span class="mord mathit mtight" style="margin-right:0.08125em;">H</span><span class="mord mathrm mtight" style="margin-right:0.02778em;">_</span><span class="mord mathit mtight" style="margin-right:0.05764em;">S</span><span class="mord mathit mtight" style="margin-right:0.07847em;">I</span><span class="mord mathit mtight" style="margin-right:0.07153em;">Z</span><span class="mord mathit mtight" style="margin-right:0.05764em;">E</span></span></span></span><span style="top:-0.22999999999999998em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span><span class="reset-textstyle textstyle uncramped frac-line"></span></span><span style="top:-0.527em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span><span class="reset-textstyle scriptstyle uncramped mtight"><span class="mord scriptstyle uncramped mtight"><span class="mord mathit mtight" style="margin-right:0.03588em;">g</span><span class="mord mathit mtight" style="margin-right:0.01968em;">l</span><span class="mord mathit mtight">o</span><span class="mord mathit mtight">b</span><span class="mord mathit mtight">a</span><span class="mord mathit mtight" style="margin-right:0.01968em;">l</span><span class="mord mathrm mtight" style="margin-right:0.02778em;">_</span><span class="mord mathit mtight">s</span><span class="mord mathit mtight">t</span><span class="mord mathit mtight">e</span><span class="mord mathit mtight">p</span></span></span></span><span class="baseline-fix"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span>&#x200B;</span></span></span><span class="mclose sizing reset-size5 size5 reset-textstyle textstyle uncramped nulldelimiter"></span></span></span></span></span></p>
<p>&#x7528;Tensorflow&#x7684;&#x51FD;&#x6570;&#x8868;&#x793A;&#x4E3A;&#xFF1A;</p>
<pre><code>global_step = tf.Varibale(0, trainable=False)
learning_rate = tf.train.exponential_decy(LEARNING_RATE_BASE,global_step,LEARNING_RATE_STEP,LEARNING_RATE_DECAY,staircase=True/False)
</code></pre><p>&#x5176;&#x4E2D;&#xFF0C;<code>LEARNING_RATE_BASE</code>&#x4E3A;&#x5B66;&#x4E60;&#x7387;&#x521D;&#x59CB;&#x503C;&#xFF0C;<code>LEARNING_RATE_DECAY</code>&#x4E3A;&#x5B66;&#x4E60;&#x7387;&#x8870;&#x51CF;&#x7387;,<code>global_step</code>&#x8BB0;&#x5F55;&#x4E86;&#x5F53;&#x524D;&#x8BAD;&#x7EC3;&#x8F6E;&#x6570;&#xFF0C;&#x4E3A;&#x4E0D;&#x53EF;&#x8BAD;&#x7EC3;&#x578B;&#x53C2;&#x6570;&#x3002;&#x5B66;&#x4E60;&#x7387;<code>learning_rate</code>&#x66F4;&#x65B0;&#x9891;&#x7387;&#x4E3A;&#x8F93;&#x5165;&#x6570;&#x636E;&#x96C6;&#x603B;&#x6837;&#x672C;&#x6570;&#x9664;&#x4EE5;&#x6BCF;&#x6B21;&#x5582;&#x5165;&#x6837;&#x672C;&#x6570;&#x3002;&#x82E5;<code>staircase</code>&#x8BBE;&#x7F6E;&#x4E3A;<code>True</code>&#x65F6;&#xFF0C;&#x8868;&#x793A; <code>global_step/learning_rate_step</code>&#x53D6;&#x6574;&#x6570;&#xFF0C;&#x5B66;&#x4E60;&#x7387;&#x9636;&#x68AF;&#x578B;&#x8870;&#x51CF;;&#x82E5;<code>staircase</code>&#x8BBE;&#x7F6E;&#x4E3A;<code>false</code>&#x65F6;&#xFF0C;&#x5B66;&#x4E60;&#x7387;&#x4F1A;&#x662F;&#x4E00;&#x6761;&#x5E73;&#x6ED1;&#x4E0B;&#x964D;&#x7684;&#x66F2;&#x7EBF;&#x3002;
&#x4F8B;&#x5982;:&#x5728;&#x672C;&#x4F8B;&#x4E2D;&#xFF0C;&#x6A21;&#x578B;&#x8BAD;&#x7EC3;&#x8FC7;&#x7A0B;&#x4E0D;&#x8BBE;&#x5B9A;&#x56FA;&#x5B9A;&#x7684;&#x5B66;&#x4E60;&#x7387;&#xFF0C;&#x4F7F;&#x7528;&#x6307;&#x6570;&#x8870;&#x51CF;&#x5B66;&#x4E60;&#x7387;&#x8FDB;&#x884C;&#x8BAD;&#x7EC3;&#x3002;&#x5176;&#x4E2D;&#xFF0C;&#x5B66;&#x4E60;&#x7387;&#x521D;&#x503C;&#x8BBE;&#x7F6E;&#x4E3A; 0.1&#xFF0C;&#x5B66;&#x4E60;&#x7387;&#x8870;&#x51CF;&#x7387;&#x8BBE;&#x7F6E;&#x4E3A;0.99&#xFF0C;BATCH_SIZE&#x8BBE;&#x7F6E;&#x4E3A;1&#x3002;</p>
<p>&#x4EE3;&#x7801;&#x5982;&#x4E0B;&#xFF1A;</p>
<pre><code>#encoding:utf-8
#&#x8BBE;&#x635F;&#x5931;&#x51FD;&#x6570;loss=(w+2)^2&#xFF0C;&#x4EE4;w&#x521D;&#x503C;&#x662F;&#x5E38;&#x6570;10&#x3002;&#x53CD;&#x5411;&#x4F20;&#x64AD;&#x5C31;&#x662F;&#x6C42;&#x6700;&#x4F18;w&#xFF0C;&#x5373;&#x6C42;&#x6700;&#x5C0F;loss&#x5BF9;&#x5E94;&#x7684;w&#x503C;
#&#x4F7F;&#x7528;&#x6307;&#x6570;&#x8870;&#x51CF;&#x7684;&#x5B66;&#x4E60;&#x7387;&#xFF0C;&#x5728;&#x8FED;&#x4EE3;&#x521D;&#x671F;&#x5F97;&#x5230;&#x8F83;&#x9AD8;&#x7684;&#x4E0B;&#x964D;&#x901F;&#x5EA6;&#xFF0C;&#x53EF;&#x4EE5;&#x5728;&#x8F83;&#x5C0F;&#x7684;&#x8BAD;&#x7EC3;&#x8F6E;&#x6570;&#x4E0B;&#x53D6;&#x5F97;&#x66F4;&#x6709;&#x6536;&#x655B;&#x5EA6;&#x3002;
import tensorflow as tf

LEARNING_RATE_BASE = 0.1   #&#x521D;&#x59CB;&#x5B66;&#x4E60;&#x7387;
LEARNING_RATE_DECAY = 0.99 #&#x5B66;&#x4E60;&#x8870;&#x51CF;&#x7387;
LEARNING_RATE_STEP = 1     #&#x5582;&#x5165;&#x591A;&#x5C11;&#x8F6E;BATCH_SIZE&#x540E;&#xFF0C;&#x66F4;&#x65B0;&#x4E00;&#x6B21;&#x5B66;&#x4E60;&#x7387;&#xFF0C;&#x4E00;&#x822C;&#x8BBE;&#x4E3A;&#xFF1A;&#x603B;&#x6837;&#x672C;&#x6570;/BATCH_SIZE

#&#x8FD0;&#x884C;&#x4E86;&#x51E0;&#x8F6E;BATCH_SIZE&#x7684;&#x8BA1;&#x6570;&#x5668;&#xFF0C;&#x521D;&#x503C;&#x7ED9;0&#xFF0C;&#x8BBE;&#x4E3A;&#x4E0D;&#x88AB;&#x8BAD;&#x7EC3;
global_step = tf.Variable(0, trainable=False)
#&#x5B9A;&#x4E49;&#x6307;&#x6570;&#x4E0B;&#x964D;&#x5B66;&#x4E60;&#x7387;
learning_rate = tf.train.exponential_decay(LEARNING_RATE_BASE, global_step, LEARNING_RATE_STEP, LEARNING_RATE_DECAY, staircase=True)
#&#x5B9A;&#x4E49;&#x5F85;&#x4F18;&#x5316;&#x53C2;&#x6570;&#xFF0C;&#x521D;&#x503C;&#x7ED9;10
w = tf.Variable(tf.constant(5, dtype=tf.float32))
#&#x5B9A;&#x4E49;&#x635F;&#x5931;&#x51FD;&#x6570;loss
loss = tf.square(w+1)
#&#x5B9A;&#x4E49;&#x53CD;&#x5411;&#x4F20;&#x64AD;&#x65B9;&#x6CD5;
train_step = tf.train.GradientDescentOptimizer(learning_rate).minimize(loss, global_step=global_step)

#&#x751F;&#x6210;&#x4F1A;&#x8BDD;&#x8BAD;&#x7EC3;40&#x8F6E;
with tf.Session() as sess:
  init_op = tf.global_variables_initializer()
  sess.run(init_op)
  for i in range(40):
    sess.run(train_step)
    learning_rate_val = sess.run(learning_rate)
    global_step_val = sess.run(global_step)
    w_val = sess.run(w)
    loss_val = sess.run(loss)
    print(&quot;After %s steps: global_step is %f, w is %f, learning rate is %f, loss is %f&quot; % (i, global_step_val, w_val, learning_rate_val, loss_val))
</code></pre><p>&#x8FD0;&#x884C;&#x7ED3;&#x679C;&#x5982;&#x4E0B;&#xFF1A;</p>
<pre><code>After 35 steps: global_step is 36.000000, w is -0.992297, learning_rate is 0.069641, loss is 0.000059
After 36 steps: global_step is 37.000000, w is -0.993369, learning_rate is 0.068945, loss is 0.000044
After 37 steps: global_step is 38.000000, w is -0.994284, learning_rate is 0.068255, loss is 0.000033
After 38 steps: global_step is 39.000000, w is -0.995064, learning_rate is 0.067573, loss is 0.000024
After 39 steps: global_step is 40.000000, w is -0.995731, learning_rate is 0.066897, loss is 0.000018
</code></pre><p>&#x7531;&#x7ED3;&#x679C;&#x53EF;&#x4EE5;&#x770B;&#x51FA;&#xFF0C;&#x968F;&#x7740;&#x8BAD;&#x7EC3;&#x8F6E;&#x6570;&#x589E;&#x52A0;&#x5B66;&#x4E60;&#x7387;&#x5728;&#x4E0D;&#x65AD;&#x51CF;&#x5C0F;&#x3002;</p>
<footer class="page-footer"><span class="copyright">Copyright &#xA9; scottdu 2018 all right reserved&#xFF0C;powered by Gitbook</span><span class="footer-modification">&#x8BE5;&#x6587;&#x4EF6;&#x4FEE;&#x8BA2;&#x65F6;&#x95F4;&#xFF1A;
2018-09-18 19:09:43
</span></footer> <link rel="stylesheet" type="text/css" href="https://storage.googleapis.com/app.klipse.tech/css/codemirror.css"> <script>     window.klipse_settings = {         selector: ".language-klipse, .lang-eval-clojure",         selector_eval_js: ".lang-eval-js",         selector_eval_python_client: ".lang-eval-python",         selector_eval_php: ".lang-eval-php",         selector_eval_scheme: ".lang-eval-scheme",         selector_eval_ruby: ".lang-eval-ruby",         selector_reagent: ".lang-reagent",        selector_google_charts: ".lang-google-chart",        selector_es2017: ".lang-eval-es2017",        selector_jsx: ".lang-eval-jsx",        selector_transpile_jsx: ".lang-transpile-jsx",        selector_render_jsx: ".lang-render-jsx",        selector_react: ".lang-react",        selector_eval_markdown: ".lang-render-markdown",        selector_eval_lambdaway: ".lang-render-lambdaway",        selector_eval_cpp: ".lang-eval-cpp",        selector_eval_html: ".lang-render-html",        selector_sql: ".lang-eval-sql",        selector_brainfuck: "lang-eval-brainfuck",        selector_js: ".lang-transpile-cljs"    }; </script> <script src="https://storage.googleapis.com/app.klipse.tech/plugin/js/klipse_plugin.js"></script>
                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="section2.1.html" class="navigation navigation-prev " aria-label="Previous page: 第一节 损失函数">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="section2.3.html" class="navigation navigation-next " aria-label="Next page: 第三节 滑动平均">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"第二节 学习率","level":"1.3.2","depth":2,"next":{"title":"第三节 滑动平均","level":"1.3.3","depth":2,"path":"chapter2/section2.3.md","ref":"chapter2/section2.3.md","articles":[]},"previous":{"title":"第一节 损失函数","level":"1.3.1","depth":2,"path":"chapter2/section2.1.md","ref":"chapter2/section2.1.md","articles":[]},"dir":"ltr"},"config":{"plugins":["katex","expandable-chapters-small","tbfed-pagefooter","alerts","copy-code-button","puml","graph","chart","klipse","donate","simple-page-toc","splitter"],"root":".","styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"tbfed-pagefooter":{"copyright":"Copyright &copy scottdu 2018","modify_label":"该文件修订时间：","modify_format":"YYYY-MM-DD HH:mm:ss"},"puml":{},"simple-page-toc":{"maxDepth":3,"skipFirstH1":true},"splitter":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"graph":{},"donate":{"alipay":"http://ovhbzkbox.bkt.clouddn.com/2018-08-11-alipay1.jpeg","alipayText":"支付宝打赏","button":"赏","title":"","wechat":"http://ovhbzkbox.bkt.clouddn.com/2018-08-11-wechatpay.png","wechatText":"微信打赏"},"katex":{},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"alerts":{},"expandable-chapters-small":{},"copy-code-button":{},"klipse":{"myConfigKey":"it's the default value"},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"chart":{"type":"c3"}},"theme":"default","author":"scottdu","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Tensorflow学习笔记","language":"zh-hans","gitbook":"3.2.3","description":"记录Tensorflow的学习内容"},"file":{"path":"chapter2/section2.2.md","mtime":"2018-09-18T11:09:43.341Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-09-25T05:55:22.995Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-alerts/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-copy-code-button/toggle.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-donate/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-splitter/splitter.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

